package cn.edu.scau.cmi.wangzm.composite.consistent;

import java.util.Set;

public class ConsistentLeaf extends ConsistentComponent {
    private String name;
	@Override
	public ConsistentComponent addChild(ConsistentComponent child) {
		System.out.println("叶子节点不可添加子节点！");
		return this;
	}

	@Override
	public ConsistentComponent deleteChild(ConsistentComponent child) {
		System.out.println("叶子节点无子节点可删除！");
		return this;
	}

	@Override
	public Set<ConsistentComponent> getChildren() {
		System.out.println("叶子节点无子节点！");
		return null;
	}

	@Override
	public String Run() {
		System.out.println("一致性组合模式，叶子节点");
		return "一致性组合模式，叶子节点";
	}

	@Override
	public ConsistentComponent getParent() {
		// TODO Auto-generated method stub
		return this.getParent();
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
